<?php
include 'autoload.php';

use models\DbMysql;
use models\Util;

class query{
	
	private $mysqldb;
	
	//初始化
	public function __construct(){
		$this->mysqldb = new DbMysql();
	}
	
	/**
	 * 查询
	 */
	public function select($sql){
		return $this->mysqldb->select($sql);
	}
	
	/**
	 * 修改数据
	 */
	public function update($sql){
		return $this->mysqldb->update($sql);
	}
	
	/**
	 * 插入
	 */
	public function insert($sql){
		return $this->mysqldb->insert($sql);
	}
	
	public function execute($sql){
		return $this->mysqldb->execute($sql);
	}
	
	//测试util
	public function test(){
		$util = new Util();
		$util->demo();
		echo "\r\n".testfun();
	}
}

$q = new query();
//$select = $q->select('select * from cthink_auth_member where uid=14 order by uid desc limit 1');
//$update = $q->update('UPDATE cthink_auth_member SET `nickname`="管理员" , `email`="zhanghd1987@foxmail.com" WHERE `uid`=14');
//$insert = $q->insert('INSERT INTO cthink_auth_member (`uid`,`username`,`nickname`,`password`,`phone`,`email`) VALUES (null,"zhanghd7751","半瓶矿泉水1","a6eacfbac7f5858f2d67323921f58d1f","13580456982","aaeea@qq.com")');
//$exec = $q->execute('DELETE from cthink_auth_member WHERE uid in(105,104)');
//if($exec){
//	echo "y";
//}else{
//	echo "n";
//}

$q->test();